using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using UwinEducation.Domain.Entities;
using UwinEducation.Shared.Models;
using UwinEducation.Shared.Enums;

namespace UwinEducation.Domain.IRepositories
{
    /// <summary>
    /// 订单支付仓储接口
    /// </summary>
    public interface IOrderPaymentRepository : IRepository<OrderPayment, Guid>
    {
        /// <summary>
        /// 根据订单ID获取支付记录列表
        /// </summary>
        /// <param name="orderId">订单ID</param>
        /// <returns>支付记录列表</returns>
        Task<List<OrderPayment>> GetByOrderIdAsync(Guid orderId);



        /// <summary>
        /// 分页获取订单支付记录
        /// </summary>
        /// <param name="request">分页请求参数</param>
        /// <returns>分页结果</returns>
        Task<PagedResult<OrderPayment>> GetPagedAsync(OrderPaymentPageRequest request);

        /// <summary>
        /// 批量添加支付记录
        /// </summary>
        /// <param name="payments">支付记录列表</param>
        Task AddRangeAsync(List<OrderPayment> payments);

        /// <summary>
        /// 批量更新支付记录
        /// </summary>
        /// <param name="payments">支付记录列表</param>
        Task UpdateRangeAsync(List<OrderPayment> payments);

        /// <summary>
        /// 批量删除支付记录
        /// </summary>
        /// <param name="payments">支付记录列表</param>
        Task DeleteRangeAsync(List<OrderPayment> payments);

        /// <summary>
        /// 计算订单的总支付金额
        /// </summary>
        /// <param name="orderId">订单ID</param>
        /// <returns>总支付金额</returns>
        Task<decimal> GetTotalPaidAmountAsync(Guid orderId);
    }
}